﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;

namespace Reborn_WorldServer.App1AppHandler
{
    public class TrainerWeaponSkill
    {
        public WeaponSkill weaponSkill;
        public int overrideCost;
        public string purchaseStatus;

        public string toXML()
        {
            string result = "";

            StringWriter stringWriter = new StringWriter();
            XmlTextWriter xmldoc = new XmlTextWriter(stringWriter);

            xmldoc.WriteStartElement("TrainerWeaponSkill");
            xmldoc.WriteAttributeString("overrideCost", overrideCost.ToString());
            xmldoc.WriteAttributeString("purchaseStatus", purchaseStatus.ToString());

            xmldoc.WriteRaw(weaponSkill.toXML());

            xmldoc.WriteEndElement();

            xmldoc.Flush();

            xmldoc.Close();

            stringWriter.Flush();

            result = stringWriter.ToString();

            return result;
        }
    }
}
